package predatorpreytest.macro.builder;

import repast.simphony.engine.environment.RunEnvironment;
import repast.simphony.parameter.Parameters;
import util.PredatorPreyScenarioBuilder;
import PredatorPrey.Grass;
import PredatorPrey.Sheep;
import PredatorPrey.Wolf;

public class ExpectedScenarioBuilder extends PredatorPreyScenarioBuilder {

	@SuppressWarnings({ "unchecked" })
	@Override
	protected void createAgents() {
		Parameters p = RunEnvironment.getInstance().getParameters();
		int numWolves = (Integer) p.getValue("initialnumberofwolves");
		int numSheep = (Integer) p.getValue("initialnumberofsheep");

		// create wolfs
		for (int i = 0; i < numWolves; i++) {
			Wolf wolf = new Wolf();
			getContext().add(wolf);
		}
		// create sheeps
		for (int i = 0; i < numSheep; i++) {
			Sheep sheep = new Sheep();
			getContext().add(sheep);
		}

		// Populate the patch grid with grass
		for (int i = 0; i < 50; i++) {
			for (int j = 0; j < 50; j++) {
				new Grass(getContext(), i, j);
			}
		}

	}

}
